home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / init.d / readahead < prev    next >
Encoding:
Text File  |  2007-04-13  |  1.5 KB  |  60 lines

  1. #!/bin/sh -e
  2. # init script for readahead
  3.  
  4. # Check the package is still installed
  5. [ -x /sbin/readahead-list ] || exit 0
  6.  
  7. # Get LSB functions
  8. . /lib/lsb/init-functions
  9. . /etc/default/rcS
  10.  
  11.  
  12. # Remember that any major changes to this script need to also be made to
  13. # readahead-desktop.init
  14.  
  15. # Remove the boot list to disable this readhead phase
  16. [ -r /etc/readahead/boot ] || exit 0
  17.  
  18. case "$1" in
  19.     start|restart|force-reload)
  20.     # This can take a while
  21.     if type usplash_write >/dev/null 2>&1; then
  22.         usplash_write "TIMEOUT 360" || true
  23.     fi
  24.  
  25.     # If "profile" is placed on the kernel command-line we watch the boot
  26.     # sequence and generate new readahead lists, rather than read the lists
  27.     if ! grep -q "profile" /proc/cmdline; then
  28.         log_begin_msg "Reading files needed to boot..."
  29.         if /sbin/start-stop-daemon --start --quiet \
  30.         --pidfile /var/run/readahead-list.bogus \
  31.         --startas /sbin/readahead-list -- -s /etc/readahead/boot; then
  32.         log_end_msg 0
  33.         else
  34.         log_end_msg $?
  35.         fi
  36.     else
  37.         log_begin_msg "Preparing to profile boot sequence..."
  38.         if /sbin/start-stop-daemon --start --quiet \
  39.         --pidfile /var/run/readahead-watch.bogus \
  40.         --startas /sbin/readahead-watch -- -o /etc/readahead/boot; then
  41.         log_end_msg 0    
  42.         else
  43.         log_end_msg $? || true
  44.         fi 
  45.     fi
  46.  
  47.     if type usplash_write >/dev/null 2>&1; then
  48.         usplash_write "TIMEOUT 15" || true
  49.     fi
  50.     ;;
  51.     stop)
  52.     ;;
  53.     *)
  54.     echo "Usage: /etc/init.d/readahead {start|stop|restart|force-reload}"
  55.     exit 1
  56.     ;;
  57. esac
  58.  
  59. exit 0
  60.